<template>
    <div class="goodsDescContainer">
        <!-- 标题 -->
        <div class="title" >
            <h3 v-text="goodsDesc.title"></h3>
        </div>
        <hr>
        <!-- 内容 -->
        <div class="content" v-html="goodsDesc.content"></div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                id: this.$route.params.id,
                goodsDesc: []
            }
        },
        created() {
            this.getGoodsDesc()
        },
        methods: {
            getGoodsDesc() {
                this.$http.get(`api/goods/getdesc/${ this.id }`)
                    .then(function (data) {
                        var data = data.body
                        if (data.status !== 0) return
                        console.log( data.message)
                        this.goodsDesc = data.message[0]
                    })
            }
        }
    }
</script>

<style  lang="less">
    .goodsDescContainer {
        .title {
            text-align: center;
            h3 {
                color: #226aff;
                margin: 15px 0 ;
                font-size: 16px;
            }
        }
        .content {
            img {
                width: 100%;
            }
        }
    }
</style>